package org.bozo.im.service.protocols.xmpp.stanza.util.jabber.client;

import java.util.Hashtable;

public enum Type {

	ERROR("error"),
	GET("get"),
	RESULT("result"),
	SET("set");

	private static Hashtable<String, Type> mTypes;
	
	static {
		mTypes = new Hashtable<String, Type>();
		addType(ERROR);
		addType(GET);
		addType(RESULT);
		addType(SET);
	}
	
	private static void addType(Type pNamespace) {
		mTypes.put(pNamespace.toString(), pNamespace);
	}

	public static Type valueOfType(String pType) {
		return mTypes.get(pType);
	}
	
	private String mType;
	
	private Type(String pType) {
		mType = pType;
	}
	
	@Override
	public String toString() {
		return mType;
	}
	
}
